package com.deep.spring.v4;


import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

//@Configuration
public class FilterConfig {


    @Bean
    public FilterRegistrationBean registerTestFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();

        TestFilter testFilter = new TestFilter();

        registration.setFilter(testFilter);
        registration.addUrlPatterns("/*");
        registration.setName("testFilter");
        registration.setOrder(1);  //值越小，Filter越靠前。
        return registration;
    }


}
